package com.example.lancooznbk.model.api;

import com.example.lancooznbk.service.HttpGetServer;
import com.lancoo.rxretrofitlibrary.Api.BaseApi;
import com.lancoo.rxretrofitlibrary.Api.UserInfo;
import com.lancoo.rxretrofitlibrary.listener.HttpOnNextListener;
import com.trello.rxlifecycle.components.support.RxFragment;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by Administrator on 2018\2\6 0006.
 */

public class RecentStudyApi extends BaseApi {

    private String IsRun = "1";
    private int MonthCount = 5;
    private int WeekCount = 7;


    public RecentStudyApi(HttpOnNextListener listener, RxFragment rxFragment) {
        super(listener, rxFragment);
    }

    public String getIsRun() {
        return IsRun;
    }

    public void setIsRun(String isRun) {
        IsRun = isRun;
    }

    public int getMonthCount() {
        return MonthCount;
    }

    public void setMonthCount(int monthCount) {
        MonthCount = monthCount;
    }

    public int getWeekCount() {
        return WeekCount;
    }

    public void setWeekCount(int weekCount) {
        WeekCount = weekCount;
    }


    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpGetServer httpGetServer = retrofit.create(HttpGetServer.class);
        return httpGetServer.getRecentStudyItem(UserInfo.StuId,UserInfo.SubjectId,UserInfo.GlobalGrade,
                IsRun,MonthCount,WeekCount,UserInfo.SchoolId);
    }
}
